//
//  EalbumsBaseController.m
//  电子相册
//
//  Created by zxy on 2019/1/23.
//  Copyright © 2019 zxy. All rights reserved.
//

#import "EalbumsBaseController.h"

@interface EalbumsBaseController ()

@end

@implementation EalbumsBaseController


-(UICollectionView *)collectionView{
    if(!_collectionView){
        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
        layout.minimumLineSpacing = 5;
        layout.minimumInteritemSpacing = 5;
        layout.itemSize = CGSizeMake((screenWidth - 20) / 3, (screenWidth - 20) / 3);
        layout.sectionInset = UIEdgeInsetsMake(0, 5, 0, 5);
        _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, screenWidth, 0) collectionViewLayout:layout];
        _collectionView.dataSource = self;
        _collectionView.delegate = self;
        _collectionView.scrollEnabled = NO;
        _collectionView.backgroundColor = [UIColor whiteColor];
    }
    return _collectionView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(upLoadBtnClick:) name:upLoadBtnClickName object:nil];
    [self.view addSubview:self.collectionView];
    [self setupMJRefresh];
}


#pragma mark -上传按钮点击事件
-(void)upLoadBtnClick:(NSNotification *)no{
    
}


-(void)setupMJRefresh{
    MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
    self.collectionView.mj_header = header;
    [header beginRefreshing];
    self.mjHeaderRefresh = header;
}

-(void)headerRefresh{
    
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 0;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    return [[UICollectionViewCell alloc]init];
}


-(void)dealloc{
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}



@end
